<script setup lang="ts">
import {onMounted, provide, reactive, ref} from "vue";
import SonCom from "@/components/sonCom.vue";

let box = ref()
console.log(box)
console.log(box.value)
onMounted(() => {
  console.log(box.value)
})
let son = ref()

function getEle() {
  console.log(box.value, 'getEle')
  console.log(son.value)
  console.log(son.value.msg)
  son.value.getMsg()
  // provide('toGrandKey', toGrand)
}

// let toGrand = reactive({
//   msg: '数据'
// })
let toGrand = '这是内容';
provide('toGrandKey', toGrand)
</script>

<template>
  <div ref="box">这是元素</div>
  <son-com ref="son"></son-com>
  <button @click="getEle">getEle</button>
</template>

<style scoped>

</style>
